﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ExtensionMethods
{
    public static class Extensions
    {
        /// <summary>
        /// Given an array of criteria, will return true if one or more of the items in criteria partially matches the string.
        /// </summary>
        /// <param name="str"></param>
        /// <param name="criteria"></param>
        /// <returns></returns>
        public static bool Contains(this System.String str, IEnumerable<string> criteria)
        {
            foreach (string s in criteria)
            {
                if (str.Contains(s))
                {
                    return true;
                }
            }

            return false;
        }
    }
}
